package cn.edu.scau.cmi.zhangjunming.adapter;

import java.util.ArrayList;
import java.util.List;

public class ClassAdapter extends SortUtil implements Target {

    public List<Integer> intList;
    public List<Student> stuList;
    
	public ClassAdapter() {
		intList = new ArrayList<Integer>();
	    stuList = new ArrayList<Student>();
		
	}
	
	public List<Student> sortStudent(List<Integer> intL,List<Student> stuL) {
		stuList.clear();
		intList =new ArrayList<Integer>(sortInt(intL));
		//List<Student> newStuL;
		for(int i=0;i<intL.size();i++) {
			for(int j=0;j<stuL.size();j++) {
				if(stuL.get(j).getNum()==intL.get(i)) {
					stuList.add(stuL.get(j));
					break;
				}
			}
		}
		
		return stuList;
	}
    
}
